  <?php use_helper('Object', 'Validation', 'ObjectAdmin', 'I18N', 'Date') ?>
<title><?= $sf_response->getTitle() ?></title>
<td><?php 
    if ($bom->getStatus() == CommonValues::$gBomStatus['key']['Initial'])
    {
        echo link_to($bom->getWono() ? $bom->getWono() : __('-'), 'bom/edit?id='.$bom->getId());
    }
    elseif ($bom->getStatus() == CommonValues::$gBomStatus['key']['Cancel'])
    {
        echo link_to($bom->getWono() ? $bom->getWono() : __('-'), 'bom/edit?id='.$bom->getId(), array('confirm' => __('Are you sure you want to edit this canceled BOM?')));
    }
    elseif ($bom->getStatus() == CommonValues::$gBomStatus['key']['Rejected'])
    {
        echo link_to($bom->getWono() ? $bom->getWono() : __('-'), 'bom/edit?id='.$bom->getId(), array('confirm' => __('Are you sure you want to edit this rejected BOM?')));
    }
    else
        echo $bom->getWono();
        
    ?></td>
    <td><?php echo $bom->getProject() ?></td>
      <td><?php echo $bom->getClient() ?></td>
      <td><?php echo ($bom->getCreatedAt() !== null && $bom->getCreatedAt() !== '') ? format_date($bom->getCreatedAt(), "D") : '' ?></td>
      <td><?php echo link_to($bom->getComponentgroupId() ? image_tag('/sf/sf_admin/images/list.png', array('alt' => 'List', 'title' => 'List')):  __('-'), 'component/SLListBOMGroup?code='.$bom->getWono().'&componentgroup_id='.$bom->getComponentgroupId().'&bom_id='.$bom->getId()) ?></td>
      <td><?php $user = sfGuardUserPeer::retrieveByPK($bom->getUserId()); echo $user? $user->getFullname(): ''?></td>
      <td><?php echo CommonValues::$gBomStatus['value'][$bom->getStatus()] ?></td>
      <td><?php echo CommonValues::$gMRApprovalStatus['value'][$bom->getApprovalstatus()] ?></td>
  